package com.zy.dp.chainofresponsibility.example4;

public class Client
{
	public static void main(String[] args)
	{
		Handler h1 = new GeneralManager2();
		Handler h2 = new DepManager2();
		Handler h3 = new ProjectManager2();
		h3.setSuccessor(h2);
		h2.setSuccessor(h1);

		FeeRequestModel frm = new FeeRequestModel();
		frm.setFee(300);
		frm.setUser("小李");

		String ret1 = (String) h3.handleRequest(frm);
		System.out.println(ret1);

		frm.setFee(800);
		h3.handleRequest(frm);
		String ret2 = (String) h3.handleRequest(frm);
		System.out.println(ret2);

		frm.setFee(1600);
		h3.handleRequest(frm);
		String ret3 = (String) h3.handleRequest(frm);
		System.out.println(ret3);

		PreFeeRequestModel pfrm = new PreFeeRequestModel();
		pfrm.setFee(3000);
		pfrm.setUser("小张");

		h3.handleRequest(pfrm);

		pfrm.setFee(6000);
		h3.handleRequest(pfrm);

		pfrm.setFee(36000);
		h3.handleRequest(pfrm);
	}
}
